//
//  ItemCell.m
//  UICollectionViewDemo
//
//  Created by develop on 15/11/27.
//  Copyright © 2015年 jicaas. All rights reserved.
//

#import "ItemCell.h"
#import "UIImageView+WebCache.h"

#import "SDCycleScrollView.h"

@interface ItemCell()<SDCycleScrollViewDelegate>

@property (nonatomic, strong) SDCycleScrollView *adScrollView;

@end

@implementation ItemCell

-(SDCycleScrollView *)adScrollView{
    if (!_adScrollView) {
        _adScrollView = [SDCycleScrollView cycleScrollViewWithFrame:self.contentView.bounds delegate:self placeholderImage:nil];
        _adScrollView.scrollDirection = UICollectionViewScrollDirectionHorizontal;
        _adScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
        _adScrollView.autoScrollTimeInterval = 3.0f;
    }
    return _adScrollView;
}

-(void)setImageArray:(NSMutableArray *)imageArray{
    NSLog(@"setImageArray");
    _imageArray = imageArray;
    _adScrollView.imageURLStringsGroup = [_imageArray copy];
        
}

- (id)initWithFrame:(CGRect)frame {
     NSLog(@"initWithFrame");
    if (self = [super initWithFrame:frame]) {
        [self.contentView addSubview:self.adScrollView];
//        self.backgroundColor = [UIColor redColor];
    }
    return self;
}

@end
